package com.kuqi.crs.web.Filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author:kuqi
 * @createTime:2021/9/24 16:29
 * @description:
 */

@WebFilter(filterName = "ChineseEncodingFilter",value =("*.do"))
public class ChineseEncodingFilter implements Filter {
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        chain.doFilter(request,response);
    }
}
